// 此处用于存放所有登陆相关的接口请求

// 导入方法
import request from '@/utils/request'

// 1. 获取图形验证码(按需导出，需要加 return)
export const getPicCode = () => {
  return request.get('/captcha/image')
}

// 2. 获取短信验证码(按需导出，需要加 return)
export const getMsgCode = (captchaCode, captChaKey, mobile) => {
  return request.post('/captcha/sendSmsCaptcha', {
    // 传参
    form: {
      captchaCode,
      captChaKey,
      mobile

    }
  })
}

// 3.登录接口(封装)
export const codeLogin = (mobile, smsCode) => {
  return request.post('/passport/login', {
    // 传递参数
    form: {
      isParty: false,
      partyData: {},
      mobile,
      smsCode
    }
  })
}
